package com.wy.dao;


import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.wy.po.User;

public class UserDao extends HibernateDaoSupport {
	
	
	public User getUserByUsername(String username){
		
		User user = null;
		try{
			user = (User)getHibernateTemplate().get(User.class, username);
			
		}catch(DataAccessException ex){ex.printStackTrace();}
		
		return user;
	} 		
	
	public boolean insertUser(User user){		
		try{
			getHibernateTemplate().save(user);
			return true;			
		}catch(DataAccessException ex){ex.printStackTrace();
		}
		return false;
	} 	
	
	
	
}
